package csd.wyaiyr.com.config;


import csd.wyaiyr.com.service.SolimonitorService;
import csd.wyaiyr.com.service.SysUserService;
import csd.wyaiyr.com.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyJob {

    @Autowired
    private SolimonitorService solimonitorService;

    @Scheduled(cron = " 0 0 0/1 * * ?")
    private void  runPeriodNotice() {
        log.info("每小时执行1次AI数据分析>>>>>>>>>>>>>start>>>>>>>>>>>>>");
        //求出当天的数据平均数：温度 和 湿度
        String today = DateUtil.getDateAndTime("yyyy-MM-dd");
        solimonitorService.getAiAdviceBydate(today);
        log.info("每小时执行1次AI数据分析>>>>>>>>>>>>>end>>>>>>>>>>>>>");
    }



}
